<?php
/**
* @package Scribble
*/
$tplPaths = ScribbleTemplateManager::getTemplatePaths();
?>

<div class="head">
	<h1>Template Scaffolding</h1>
</div>

<?php if(!empty($generatedClass)): ?>
	<p>
		Copy and paste the class definition below into any one of the following files:
	</p>
	<?php foreach($tplPaths as $tp): ?>
		<pre class="code"><?php $this->html->e("{$tp->folder}/{$folderName}/{$className}.php") ?></pre>
	<?php endforeach; ?>

	<textarea class="fullwidth" style="font-family:monospace;" rows="50"><?php $this->html->e($generatedClass); ?></textarea>
<?php else: ?>
	<div class="std">
		<p>
			Complete the form below and press <strong>Generate</strong>
		</p>
	
		<form method="post">
			<dl>
				<dt>What type of template is this?</dt>
				<dd>
					<label><input type="radio" name="type" value="outer" <?php echo isset($template['type']) && $template['type']=='outer' ? 'checked="checked"' : ''; ?>> Outer</label><br/>
					<label><input type="radio" name="type" value="inner" <?php echo isset($template['type']) && $template['type']=='inner' ? 'checked="checked"' : ''; ?>> Inner</label>
				</dd>
			</dl>
	
			<dl class="required">
				<dt>Template name</dt>
				<dt class="aid">Use <strong>lower-hyphenated</strong> format</dt>
				<dd>
					<input class="medium" type="text" name="name" value="<?php $this->html->e(isset($template['name']) ? $template['name'] : ''); ?>" />
				</dd>
			</dl>
	
			<dl class="required">
				<dt>Template title</dt>
				<dd>
					<input class="medium" type="text" name="title" value="<?php $this->html->e(isset($template['title']) ? $template['title'] : ''); ?>" />
				</dd>
			</dl>
	
			<dl>
				<dt>Short description</dt>
				<dd>
					<input class="large" type="text" name="shortdesc" value="<?php $this->html->e(isset($template['shortdesc']) ? $template['shortdesc'] : ''); ?>" />
				</dd>
			</dl>
	
			<dl>
				<dt>Long description</dt>
				<dd>
					<textarea class="large" name="longdesc"><?php $this->html->e(isset($template['longdesc']) ? $template['longdesc'] : ''); ?></textarea>
				</dd>
			</dl>
	
			<p>
				<button class="submit" type="submit">Generate</button>
			</p>
		</form>
	</div>
<?php endif; ?>